home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / misc / phoon21_src.lha / phoonsrc / Libi / divsi3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  214 b   |  17 lines

  1. #include "common.h"
  2.  
  3. SItype
  4. __divsi3 (a, b)
  5.      SItype a, b;
  6. {
  7.   unsigned SItype q, r;
  8.   int neg = (a < 0) != (b < 0);
  9.  
  10.   if (a < 0) a = -a;
  11.   if (b < 0) b = -b;
  12.  
  13.   divmodu (q, r, a, b);
  14.  
  15.   return neg ? -q : q;
  16. }
  17.